
# ---------------------------------------------------------------------------- #
#                                  MAKEFILE                                    #
#                 Gestion_Des_Inscriptions_Universitaires                      #
#                                                                              #
# ---------------------------------------------------------------------------- #

CC 			 = gcc

SRCS_TEST    = UtilStr.c Date.c Etudiant.c UE.c Enseignant.c Login.c Enseignement.c  IP.c Enseigne.c Salle.c Controle.c ResponsableEtu.c mainTest.c Application.c

SRCS         = UtilStr.c Date.c Etudiant.c UE.c Enseignant.c Login.c Enseignement.c  IP.c Fenetre.c Application.c Enseigne.c Salle.c Controle.c ResponsableEtu.c


FINAL_TARGET = GIU
TEST_TARGET  = test

LDFLAGS  	 = `pkg-config --libs gtk+-2.0`
CFLAGS 		 = -Wall -pedantic -ansi -ggdb `pkg-config --cflags gtk+-2.0` #-O2   # pour optimiser

LIBS         = -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lglib-2.0

INCLUDE_DIR  = -I/usr/include/gtk-2.0 

#-I/usr/include/gtk-2.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12

# -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lglib-2.0 

OBJ_DIR 	 = obj
SRC_DIR 	 = src
BIN_DIR 	 = bin



default: $(BIN_DIR)/$(FINAL_TARGET) $(BIN_DIR)/$(TEST_TARGET)


$(BIN_DIR)/$(FINAL_TARGET): $(SRCS:%.c=$(OBJ_DIR)/%.o)
	$(CC) $+ -o $@ $(LDFLAGS) $(LIB_DIR) $(LIBS)

$(BIN_DIR)/$(TEST_TARGET): $(SRCS_TEST:%.c=$(OBJ_DIR)/%.o)
	$(CC) $+ -o $@ $(LDFLAGS) $(LIB_DIR) $(LIBS)

$(OBJ_DIR)/%.o: $(SRC_DIR)/%.c
	$(CC) -c $(CFLAGS) $(INCLUDE_DIR) $< -o $@



clean:
	rm -f $(OBJ_DIR)/*.o $(BIN_DIR)/$(FINAL_TARGET) $(BIN_DIR)/$(TEST_TARGET)
